<ion-view id="tab-send" show-tabs>
  <ion-nav-bar class="bar-royal">
    <ion-nav-title>{{'Send' | translate}}</ion-nav-title>
  </ion-nav-bar>
  <ion-content>

    <div class="important-message" ng-if="serverMessage" ng-click="openServerMessageLink()">
      <span>{{serverMessage.title}}</span>
      <i class="icon ion-ios-arrow-thin-right"></i>
    </div>

    <div ng-if="hasFunds">
      <div class="send-header-wrapper">
        <div class="item item-heading send-heading"><span translate>Recipient</span></div>
        <div class="item input search-wrapper" ng-class="{'focus': searchFocus}">
          <i class="icon icon-svg abs-v-center"><img class="svg" src="img/icon-bitcoin-symbol.svg"></i>
          <div class="item-icon-right">
            <input type="text" class="search-input" placeholder="{{'Search or enter wificoin address' | translate}}" ng-model="formData.search" ng-change="findContact(formData.search)" ng-model-onblur ng-focus="searchInFocus()" ng-blur="searchBlurred()">
            <i class="icon icon-svg qr abs-v-center separator-left" on-tap="openScanner()"><img src="img/scan-ico.svg"></i>
          </div>
        </div>
      </div>
    </div>

    <div ng-if="!checkingBalance && (!hasFunds || !hasWallets)">
      <div class="list card sendTip">
        <div class="item item-icon-right item-heading"></div>
        <div>
          <i class="icon zero-state-icon">
            <img src="img/tab-icons/ico-send-selected.svg"/>
          </i>
        </div>
        <div class="title" translate>
          Start sending wificoin
        </div>
        <div class="subtitle">
          <span ng-show="hasWallets" translate>To get started, get wificoin or share your address. You can receive wificoin from any wallet or service.</span>
          <span ng-show="!hasWallets" translate>To get started, you'll need to create a wificoin wallet and get some wificoin.</span>
          <div class="padding">
            <a class="button button-standard button-primary" ng-click="openExternalLink('http://www.vbitex.com/')" ng-show="hasWallets" translate>Get WiFicoin From Exchange</a>
            <a class="button button-standard button-primary" ng-click="openExternalLink('https://talkblock.org/question/87')" ng-show="hasWallets" translate>Get Free WiFicoin</a>
            <button class="button button-standard button-primary" ng-click="createWallet()" ng-show="!hasWallets" translate>Create wificoin wallet</button>
            <button class="button button-standard button-secondary" ui-sref="tabs.receive" ng-show="hasWallets" translate>Show wificoin address</button>
          </div>
        </div>
      </div>
    </div>

    <div class="card" ng-if="hasContacts && hasWallets && hasFunds">
      <div class="item item-icon-right item-heading">
        <span translate>Contacts</span>
        <a ng-if="hasContacts" ui-sref="tabs.send.addressbook">
          <i class="icon ion-ios-plus-empty list-add-button"></i>
        </a>
      </div>
      <div class="list">
        <a class="item item-icon-left item-icon-right" ng-repeat="item in list" ng-if="!item.isWallet && item.recipientType != 'wallet'" ng-click="goToAmount(item)">
          <i class="icon big-icon-svg">
            <img src="img/contact-placeholder.svg" class="bg" ng-if="isChromeApp">
            <gravatar class="send-gravatar" name="{{item.name}}" width="30" email="{{item.email}}" ng-if="!isChromeApp"></gravatar>
          </i>
          {{item.name}}
          <i class="icon bp-arrow-right"></i>
        </a>
        <div class="show-more" ng-if="contactsShowMore" ng-click="showMore()" translate>
          Show more
        </div>
      </div>
    </div>

    <div class="card" ng-if="showTransferCard && hasFunds">
      <div class="item item-heading">
        <span translate>Transfer to Wallet</span>
      </div>
      <div class="list">
        <a class="item item-icon-left item-icon-right" ng-repeat="item in list" ng-if="hasWallets && item.recipientType == 'wallet'" ng-click="goToAmount(item)">
          <i class="icon big-icon-svg" ng-if="item.recipientType == 'wallet'" ng-init="wallet = item" ng-include="'views/includes/walletIcon.html'"></i>
          {{item.name}}
          <i class="icon bp-arrow-right"></i>
        </a>
      </div>
    </div>

  </ion-content>
</ion-view>
